{% include 'header.html' %}


<div class="tab-content tabs-content-placeholder">


    <div class="panel panel-default tab-pane tabs-up active tab-content-active" id="messages">
        <table>
            <tr>
                <th>商品ID</th>
                <th>商品名称</th>
                <th>价格</th>
            </tr>
            <tbody id="goodslist">
            <tr>
                <td>暂无数据</td>
            </tr>
            </tbody>
        </table>

    </div>
    <!-- Messages Tab Ends -->

    <script type="text/javascript">
        window.onload = function () {
            var data = {{ data | safe }};
            var a = [];
            for (i in data) {
                a.push(data[i]);
            }
            var list = document.getElementById("goodslist");
            var str = '';
            for (var i = 0; i < a.length; i++) {
                str += '<tr>\
                        <td>' + a[i].id + '</td>\
                        <td>' + a[i].g_name + '</td>\
                        <td>' + a[i].g_price + '</td>\
                       </tr>'
            }
            list.innerHTML = str
        };


    </script>

    {% include 'footer.html' %}
